package chapter.fifth.item27;

public class GenericFunction {
	private static UnaryFunction<Object> IDENTITY_FUNCTION = 
			new UnaryFunction<Object>(){
		public Object apply(Object arg){return arg;}
	};
	
	@SuppressWarnings("unchecked")
	public static <T> UnaryFunction<T> indentityFunction(){
		return (UnaryFunction<T>) IDENTITY_FUNCTION;
	}
	
	public static void main(String[] args) {
		UnaryFunction<String> ss = GenericFunction.indentityFunction();
		System.out.println(ss.apply("ehllo"));
	}
}
